<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<link rel="stylesheet" href="../../assets/css/layui.css">
		<link rel="stylesheet" href="../../assets/css/view.css"/>
		<title></title>
	</head>
<body class="layui-view-body">
	<div class="layui-content">
		<div class="layui-row">
			<div class="layui-card">
				<div class="layui-card-header">录入快递员</div>
				<form id="form" class="layui-form layui-card-body" >
					<div class="layui-form-item">
						<label class="layui-form-label">快递员姓名</label>
						<div class="layui-input-block">
							<input type="text" name="username" required  lay-verify="required" placeholder="请输入快递员姓名" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">手机号码</label>
						<div class="layui-input-block">
							<input type="text" name="phonenumber" required  lay-verify="required" placeholder="请输入手机号码" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">身份证号码</label>
						<div class="layui-input-block">
							<input type="text" name="idnumber" required  lay-verify="required" placeholder="请输入身份证号码" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">密码</label>
						<div class="layui-input-block">
							<input type="text" name="password" required  lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-input-block">
							<button class="layui-btn layui-btn-blue" lay-submit lay-filter="formDemo">提交</button>
							<button type="reset" class="layui-btn layui-btn-primary">重置</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
	<script src="../../assets/layui.all.js"></script>
	<script src="/qrcode/jquery2.1.4.js"></script>
	<script src="/layer/layer.js"></script>
	<script>
		var form = layui.form
				,layer = layui.layer;
	</script>
	<script>
		$(function(){
			$("#form").submit(function(){
				var windowId = layer.load();
				var username = $("input:eq(0)").val();
				var userPhone = $("input:eq(1)").val();
				var idNumber = $("input:eq(2)").val();
				var password = $("input:eq(3)").val();
				$.post("/courier/insert.do",{
					username:username,
					userPhone:userPhone,
					idNumber:idNumber,
					password:password
				},function(data){
					layer.close(windowId);
					layer.msg(data.result);
					if(data.status == 0){
						// 录入成功
						$("input").val("");
					}else{
						// 录入失败
					}
				});
				return false;
			});
		});
	</script>
	</body>
</html>
